package cn.lijiancn01.demo;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class ViewAction {
    @GetMapping("/")
    public String index() {
        return "index";
    }

    @GetMapping("/login")
    public String login() {
        return "login";
    }

    @GetMapping("/view/{path}")
    public ModelAndView jspage(@PathVariable("path") String path) {
        ModelAndView view = new ModelAndView("view");
        view.addObject("path", path);
        return view;
    }
}
